<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" value='0' class="input">
    <input type="button" value="+1" class="add" onclick="Add()">
    <input type="button" value="-1" class="sub" onclick="Sub()">
</body>
<script>
    function Add()
    {
        let elem=document.querySelector('.input')
        elem.value=parseInt(elem.value)+1
    }

    function Sub()
    {
        let elem=document.querySelector('.input')
        elem.value=parseInt(elem.value)-1
    }
</script>
</html>